<template>
  <div>
    <TypeNav></TypeNav>
    <ListContainer></ListContainer>
    <Recommend></Recommend>
    <Rank></Rank>
    <Brand></Brand>
    <Like></Like>
    <Floor
      v-for="floor in floorList"
      :key="floor.id"
      :list="floor"
    ></Floor>
  </div>
</template>

<script>
import ListContainer from "./ListContainer"
import Recommend from "./Recommend"
import Rank from "./Rank"
import Brand from "./Brand"
import Like from "./Like"
import Floor from "./Floor"
import { mapState } from "vuex"

export default {
  name: "",
  components: {
    ListContainer,
    Recommend,
    Rank,
    Brand,
    Like,
    Floor,
  },
  mounted() {
    // 获取 floor 组件数据
    this.$store.dispatch("getFloorList")
  },
  computed: {
    ...mapState({
      floorList: (state) => state.home.floorList,
    }),
  },
}
</script>

<style lang="less" scoped>
</style>
